Page({
    data: {
        checked: false,
    },
    onChange({detail}) {
        wx.showModal({
            title: '提示',
            content: '是否切换开关？',
            success: (res) => {
                if (res.confirm) {
                    this.setData({checked: detail});
                }
            },
        });
    },
    onLoad: function (options) {

    }
});